﻿using System;
using System.Data.Common;
using System.Threading.Tasks;

namespace Gaea
{
    internal partial class GaeaConnectionProvider
    {
        public Task<DbConnection> GetConnectionAsync(GaeaOption gaeaOption)
        {
            var dbConnetion = Activator.CreateInstance(gaeaOption.TypeOfDbConnection) as DbConnection;
            dbConnetion.ConnectionString = gaeaOption.ConnectionString;
            dbConnetion.OpenAsync();
            return dbConnetion;
        }
    }
}
